<template>
  <div v-if="Object.keys(goods).length!==0" class="base-info">
      <div class="info-title">{{goods.title}}</div>
      <div class="info-price">
          <span class="n-price">{{goods.newPrice}}</span>
          <span class="o-price">{{goods.oldPrice}}</span>
          <span v-if="goods.discount" class="discount">{{goods.discount}}</span>
      </div>


      <div class="info-other">
          <span>{{goods.columns[0]}}</span>
          <span>{{goods.columns[1]}}</span>
          <span>{{goods.services[goods.services.length-1].name}}</span>
      </div>


      <div class="info-service">
          <span class="info-service-item" v-for="index in goods.services.length-1" :key="index">
              <img :src="goods.services[index-1].icon">
              <span>{{goods.services[index-1].name}}</span>
          </span>
      </div>

  </div>
</template>

<script>
export default {
    name:"DetailBaseInfo",
    props:{
        goods:{
            type:Object,
            default(){
                return {}
            }
        }
    }
}
</script>

<style>
.info-title{
    background-color: hsla(0,0%,100%,0);
    color: #111;
    font-size: 17px;
    height: 35px;
    line-height: 18px;
    margin:5px;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2; 
    overflow:hidden;

}
.info-price{
    position: relative;
    margin-left:5px;
}
.n-price{
    color: #ff0036;
    font-size: 24px;
}
.o-price{
    color: #999;
    font-size: 14px;
    margin-left: 10px;
    text-decoration: line-through;
}
.discount{
    padding:2px 5px 2px 5px ;
    background-color: rgb(241, 116, 137);
    color: #fff;
    border-radius: 5px;
    margin-left: 5px;
    box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
    
}
.info-other{
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #999;
    font-size: 15px;
    color: #999;
}
.info-service{
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-bottom: 1px solid #999;
    height: 60px;
}
.info-service-item{
    display: flex;
    flex-direction: row;
}
.info-service img{
    width: 18px;
    height: 18px;
}
.info-service-item span{
    margin-left: 2px;
}
</style>